package com.kukudexin.lockThread;

/**
 * @author: 酷酷的鑫
 * @description:
 */
public class InterruptTest02 extends Thread {
    private volatile boolean isStart = true;

    @Override
    public void run() {
        while (isStart) {
            if (this.isInterrupted()) {
                break;
            }
        }
    }

    public static void main(String[] args) {
        InterruptTest02 thread09 = new InterruptTest02();
        thread09.start();
        try {
            Thread.sleep(3000);
        } catch (Exception e) {

        }
        System.out.println("<<中断子线程>,>");
        // 中断 阻塞或者正在运行的线程
        thread09.isStart = false;
    }
}
